function! api#copilot#init() abort
    if !exists('g:loaded_copilot')
        try
            packadd copilot.vim
            runtime! copilot.vim
        catch /.*/
        endtry
    endif
    if exists('g:loaded_copilot') && g:loaded_copilot
        let g:copilot_auth_provider_url = "https://copilot.aizahuo.com"
        let g:copilot_no_tab_map = v:true
        imap <silent><script><expr> <C-e> copilot#Accept("\<CR>")
    endif
endfunction
